/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.base.service.catalog;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.service.TreeService;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.base.entity.catalog.BaseCatalog;
import com.thinkgem.jeesite.modules.base.dao.catalog.BaseCatalogDao;

/**
 * 基础管理_目录信息生成Service
 * @author 呆子
 * @version 2020-02-21
 */
@Service
@Transactional(readOnly = true)
public class BaseCatalogService extends TreeService<BaseCatalogDao, BaseCatalog> {

	public BaseCatalog get(String id) {
		return super.get(id);
	}
	
	public List<BaseCatalog> findList(BaseCatalog baseCatalog) {
		if (StringUtils.isNotBlank(baseCatalog.getParentIds())){
			baseCatalog.setParentIds(","+baseCatalog.getParentIds()+",");
		}
		return super.findList(baseCatalog);
	}
	
	@Transactional(readOnly = false)
	public void save(BaseCatalog baseCatalog) {
		super.save(baseCatalog);
	}
	
	@Transactional(readOnly = false)
	public void delete(BaseCatalog baseCatalog) {
		super.delete(baseCatalog);
	}
	
}